#define _USE_MATH_DEFINES

#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <cassert>
#include <stack>
#include <cstdlib>
#include <bitset>
#include <cmath>

#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define pb push_back
#define all(a) a.begin(),a.end()
#define sz(a) int(a.size())
#define mp make_pair

using namespace std;

typedef long long li;
typedef long double ld;

typedef pair<int,int> pt;
#define ft first
#define sc second

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9;

//#define TASK_NAME ""

string s;

bool read() {
	cin >> s;
	return s != "#";
}

int idx[7][7] = {
	{0, 1, 2, 3, 4, 5, 6}, 
	{18, 0, 17, 2, 3, 16, 5}, 
	{7, 8, 18, 0, 1, 2, 3}, 
	{8, 9, 0, 1, 10, 3, 4}, 
	{1, 10, 3, 4, 11, 6, 12}, 
	{3, 4, 5, 6, 12, 14, 13}, 
	{2, 3, 16, 5, 6, 15, 14}, 
};

int result[7] = {3, 2, 0, 1, 4, 6, 5};

int to[1 << 19];
int mask[1 << 19][7];

int nxt(int x)
{
	int res = x;
	
	forn (i, 7)
	{
		x |= 1 << result[i];
		x ^= 1 << result[i];
		if (s[mask[res][i]] == '1')
			x |= 1 << result[i];
	}

	return x;
}

void solve() {

	bool bad = false;

	forn (i, 1 << 19)
		to[i] = nxt(i);

	forn (i, 1 << 19)
		if ((to[i] & 8) != (to[to[i]] & 8))
			bad = true;

	if (bad)
		cout << "no" << endl;
	else
		cout << "yes" << endl;
}

int main() {
#ifdef TASK_NAME
	freopen(TASK_NAME ".in", "r", stdin);
	freopen(TASK_NAME ".out", "w", stdout);
#endif

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	forn (i, 1 << 19)
		forn (j, 7)
		{
			forn (k, 7)
			{
				if (i & (1 << idx[j][k]))
					mask[i][j] ^= 1 << k;
			}
		}

	while (read())
		solve();

	return 0;
}